<?php

	if($authInfo->usertype != '0') {
		redirectCleanly("/");
	}

	include_once("cmsConfig.php");// this should have already been included..
	include_once(CMS_HOME_DIR."lib/cmsSearch.php");
	
	//$tableWriter = new CmsTableWriter(CMS_FORMAT,$db);
	
	
	//check if we are a root use before running this..
	
//	{
?>
<html>
<head>
<title><?= TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="/cms.css" type="text/css">
<link href="/main.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="770" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="15"><img src="/images/main_r1_c1.gif" width="15" height="50" border="0"></td>
    <td width="745" valign="top" class="body10"><a href="/index.php" class="link10bold">Home</a> 
      &gt; <a href="/admin_home.php" class="link10">Admin</a> &gt; <a href="/cms/html/index.php" class="link10">Add 
      content to database</a> &gt; Index Content<br>
      <table width="755" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="105" valign="top">
<table width="135" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td> 
                  </td>
                <td width="8%"><img src="/images/spacer.gif" width="20" height="8" border="0"></td>
              </tr>
            </table></td>
          <td width="650" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="body2">
              <tr> 
                <td colspan="3"><img src="/images/spacer.gif" width="100" height="5"></td>
              </tr>
              <tr> 
                <td width="31%" class="body2-7">&nbsp;</td>
                <td class="body2-7" colspan="2"> 
<?   
	print_r($authInfo);               
	if ($authInfo->usertype == 0) {
	    			indexAllDocuments($db);
	} else {
		echo "Permission Denied";
	}
?>
                </td>
              </tr>
              <tr> 
                <td colspan="3" class="body2"><img src="/images/spacer.gif" width="450" height="10"></td>
              </tr>
            </table></td>
        </tr>
      </table> </td>
  </tr>
</table>
</body>
</html>